from pydantic import BaseModel
from typing import Optional

class KnowledgePointBase(BaseModel):
    name: str
    description: Optional[str] = None
    grade_id: int

class KnowledgePointCreate(KnowledgePointBase):
    pass

class KnowledgePoint(KnowledgePointBase):
    id: int
    
    class Config:
        from_attributes = True